Repository navigation
fix(v2): name SSL.com product codes on sync, accept requests with no CN, and log the plugin version - #53
Merged
Conversation
…mplate Accounts that issue through SSL.com list catalog codes 1011-1020 with productTypeIDs 47-56. Sync named a code only through the emSign type IDs (13-22), so SSL.com records kept the raw code and the gateway assigned no template. SslComProductTypeIdsV2 maps the same product names to the SSL.com types, and the sync name lookup reads both maps. Enrollment is unchanged.
…ework at Initialize The plugin logged nothing that identifies the running build, and the gateway logs only its own version, so a customer log couldn't say which release produced it. Initialize now logs the assembly's informational version (as CI stamps it), whether the build includes DCV support, and the target framework. The line is written before the configuration is validated, so it is present even when Initialize throws.
…o CN A V2 SSL/TLS request with an empty subject (names only in the SANs) failed with "Cannot determine primary domain" before any CA call. The V2 spec requires certificate.domain but not a CSR CN, and CERTInext issues an empty-subject CSR with CN = certificate.domain. When there is no CN, the domain is now the first DNS SAN that isn't a wildcard, else the first wildcard one, from the same SAN source as additionalDomains. A plain name comes first so that *.example.com + example.com is a UCC order and keeps both names. Private PKI still requires a CN.
…hout one; document the SAN fallback for DomainName
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Three changes:
Sync turns a CERTInext product code into a product name (for example
DV SSL) by looking up the code'sproductTypeIDin the account's catalog. SSL.com products (codes1011-1020) use type IDs 47-56, which the plugin didn't know. Those certificates kept the raw code, and the gateway assigned them no template.A V2 SSL/TLS request whose subject has no CN failed with "Cannot determine primary domain" before any call to CERTInext. The V2 spec requires
certificate.domainbut doesn't require a CN in the CSR, so the plugin now takes the domain from the SANs.Features
InitializelogsCERTInext CA plugin version <InformationalVersion>. DcvSupport=<bool>, TargetFramework=<tfm>. The version is the one the build stamps, and the line is written before the config is validated, so it appears even when initialization fails.Fixes
Constants.Products.SslComProductTypeIdsV2table holds them, and sync's name lookup now reads it alongside the existing emSign table (ProductTypeIdsV2, types 13-22). Enrollment is unchanged: it still detects UCC products by product name throughProductTypeIdsV2.domainis the first DNS SAN that isn't a wildcard, or else the first wildcard one (PrimaryDomainFromSans). It reads the same SAN source asadditionalDomains: Command's SAN list, or the CSR's SANs when Command sends none.*.example.comalone: a wildcard order.*.example.com+example.com:example.comis the domain and the wildcard goes inadditionalDomains, so the certificate gets both names.Chores
configuration.mdcovers SSL.com codes in "Templates for synced certificates" and says that a code the account's catalog no longer lists is passed on unchanged. TheDomainNamerow describes the SAN fallback.Testing
make testpasses (unit tests): 1,422 tests in Releasemake integration-testpasses (requires~/.env_certinext)make coverageshows no coverage regressionRelease builds of both variants (
DcvSupporttrue and false) have 0 warnings.New and updated tests:
CERTInext.Tests/SyncProductIdTests.cs:ProductNameForTypeId_MapsPluginProductTypes: cases for each of the 10 SSL.com type IDs (47-56).EveryAdvertisedProductHasATypeId_AndMapsBackToItself: every product name also has an SSL.com type ID that maps back to it.V2Sync_SslComCatalog_NamesSslComProductCodes: a V2 sync against an SSL.com catalog names1011,1012,1013and1020, keeps a Private PKI code unchanged, and reportsProductNames: Resolved=4, Unresolved=1.CERTInext.Tests/V2NoCnEnrollmentTests.cs:additionalDomains.PrimaryDomainFromSanscases.CERTInext.Tests/PluginVersionLoggingTests.cs:PluginVersionequals the assembly's informational version.Initializerejects the config.